package com.yycwxt.modules.admin.data_import;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface ImpFileMapper extends BaseMapper<ImpFile> {
    @Select("select b.id,a.value name,b.filename,b.zq,b.url,b.remark,b.created from\n" +
            "        (select distinct value value from sys_dictionary where name='文件清单') a\n" +
            "            left outer join imp_files b on a.value=b.name and b.zq=#{zq}")
    public List<ImpFile> selectImpFiles(@Param("zq") Integer zq);

    @Select("call impERPStoreOrder(" +
            "#{pzq,mode=IN,jdbcType=VARCHAR}, " +
            "#{pddbh,mode=IN,jdbcType=VARCHAR}, #{pdpmc,mode=IN,jdbcType=VARCHAR}, #{pckmc,mode=IN,jdbcType=VARCHAR}, #{pysdh,mode=IN,jdbcType=VARCHAR}, " +
            "#{pssx,mode=IN,jdbcType=VARCHAR}, #{pdhdd,mode=IN,jdbcType=VARCHAR}, #{pwlgs,mode=IN,jdbcType=VARCHAR}, #{pwldh,mode=IN,jdbcType=VARCHAR}, " +
            "#{phpzls,mode=IN,jdbcType=INTEGER}, #{phpzs,mode=IN,jdbcType=INTEGER}," +
            "#{pygzl,mode=IN,jdbcType=DECIMAL}, #{pqz,mode=IN,jdbcType=INTEGER}, #{phpsjbm,mode=IN,jdbcType=VARCHAR});"
    )
    public void importErpStoreOrder(
            Integer pzq,
            String pddbh, String pdpmc, String pckmc, String pysdh,
            String pssx, String pdhdd, String pwlgs, String pwldh,
            Integer phpzls, Integer phpzs,
            BigDecimal pygzl, Integer pqz, String phpsjbm
    );
}
